<?php

class It_Model_Usersroles extends Zend_Db_Table_Abstract
{
    protected $_name = 'users_roles';
    
    public function getDataByUserID ($userId)
    {
    	$query = $this->select();
        $query->from($this->_name,array('roleId'));
        $query->where('userId = ?',$userId);
        return $this->fetchAll($query);
    }
    public function addMultiData($userRole){
        $sql = 'INSERT INTO users_roles (userId, roleId) VALUES '. implode(',', $userRole);
            
		$stmt = $this->getAdapter()->prepare($sql);
		$stmt->execute();
    }
    public function deleteUserId ($userId)
    {
        $this->delete('userId =' . (int) $userId);  
    }
    //chua su dung
}

